package com.yonghui.sandbox.controller;

import com.yonghui.sandbox.dto.UserDTO;
import com.yonghui.sandbox.service.UserService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description: TODO
 * @author: zhangtong
 * @create: 2021-03-10 15:01
 **/
@RestController
@RequestMapping("/user")
public class UserController {


    @DubboReference(version = "${sandbox.service.version}")
    private UserService userService;

    @GetMapping(value = "/getList")
    public Object getList(String name){
        System.out.println("getList name = " + name);
        List<UserDTO> list = userService.findList(name);
        return list;
    }
}
